package cn.pegasus.teamwork.pegasus.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.pegasus.teamwork.pegasus.entity.BussUserConsumorder;
import cn.pegasus.teamwork.pegasus.entity.BussUserReward;
import cn.pegasus.teamwork.pegasus.mapper.BussUserRewardMapper;
import cn.pegasus.teamwork.pegasus.service.BussUserRewardService;
import cn.iyizhan.teamwork.base.service.impl.BaseServiceImpl;
import cn.iyizhan.teamwork.base.util.PageHelper;
import cn.iyizhan.teamwork.base.util.PageObject;

/**
 * @author ryan.bian
 * @version 
 */
@Service("bussUserRewardService")
public class BussUserRewardServiceImpl extends BaseServiceImpl<BussUserReward, BussUserRewardMapper> implements BussUserRewardService {
	// 注入当前dao对象
    @Autowired
    private BussUserRewardMapper bussUserRewardMapper;

    public BussUserRewardServiceImpl() {
        setMapperClass(BussUserRewardMapper.class, BussUserReward.class);
    }

	@Override
	public BussUserReward findBussUserRewardInfo(Integer id) {
		BussUserReward r = new BussUserReward();
		r.setId(id);
		return bussUserRewardMapper.selectSingle(r);
	}

	@Override
	public PageObject<BussUserReward> PageList(Map<String, Object> map) {
		int totalData = bussUserRewardMapper.getTotal(map);
        PageHelper pageHelper = new PageHelper(totalData, map);
        List<BussUserReward> list = bussUserRewardMapper.findListByPage(pageHelper.getMap());
        PageObject<BussUserReward> pageObject = pageHelper.getPageObject();
        pageObject.setDataList(list);
		return pageObject;
	}
    
 
}
